/**
 * 
 */
package com.globalresources.business.impl;

import java.util.List;
import com.globalresources.business.inface.IHospitalService;
import com.globalresources.po.Hospital;
import com.globalresources.dao.inface.IHospitalDao;

/**
 * @author Administrator
 *
 */
public class HospitalServiceImpl implements IHospitalService {
	 private IHospitalDao hospitalDao;
	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.IHospitalService#deleteHospital(com.globalresources.po.Hospital)
	 */
	public boolean deleteHospital(Hospital hospital) {
		// TODO Auto-generated method stub
		return hospitalDao.deleteHospital(hospital);
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.IHospitalService#editHospital(com.globalresources.po.Hospital)
	 */
	public boolean saveOrUpdateHospital(Hospital hospital) {
		// TODO Auto-generated method stub
		
		return hospitalDao.saveOrUpdateHospital(hospital);
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.IHospitalService#getHospitalById()
	 */
	public Hospital getHospitalById(String id) {
		// TODO Auto-generated method stub
		return (Hospital)(hospitalDao.findBySql("from Hospital hospital where hospital.id='"+id+"'").get(0));
		
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.IHospitalService#listHopistal()
	 */
	public List<Hospital> listHopistal() {
		// TODO Auto-generated method stub
		return hospitalDao.findAll();
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.IHospitalService#saveHospital(com.globalresources.po.Hospital)
	 */
	public boolean saveHospital(Hospital hospital) {
		// TODO Auto-generated method stub
		return hospitalDao.saveHospital(hospital);
	}

	/**
	 * @return the hospitalDao
	 */
	public IHospitalDao getHospitalDao() {
		return hospitalDao;
	}

	/**
	 * @param hospitalDao the hospitalDao to set
	 */
	public void setHospitalDao(IHospitalDao hospitalDao) {
		this.hospitalDao = hospitalDao;
	}

}
